<?php defined('SYSPATH') or die('No direct script access.');

/**
 * Enter description here...
 *
 * @package    	Kohadmin
 * @subpackage	Libraries
 * @author     	Thomas Filius
 * @copyright  	(c) 2009 Nobis Stultius IT
 * @license		GNU Lesser General Public License 3
 * @version		$Id $
 */
class KohadminForm_Core
{
	public $_form_name;
	public $_form_action;
	public $_form_method = "post";

	public $_error;
	public $_sent = FALSE;
	public $_elements = array();

	public function __construct ($name = NULL, $options = array())
	{

	}

	public static function factory ($name = NULL, $options = array())
	{
		return new KohadminForm ($name, $options);
	}

	public function __toString ()
	{
		return $this->get();
	}

	public function validate ($append_errors = FALSE)
	{
		if ( ! $this->_sent)
			return;

		return ($this->error) ? FALSE : TRUE;
	}

	public function get ($as_array = FALSE)
	{
		if ($this->_sent)
		{
			$this->validate();
		}

		$return = ($as_array == TRUE) ? $this->_get_array() : $this->_get();

		return $return;
	}

	private function _get_array ()
	{

	}

	private function _get ()
	{

	}
}
?>
